package com.uzai.console.web.report.v2;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.dto.device.DeviceQuery;
import com.uzai.console.dto.report.RealTimeOverviewReportDto;
import com.uzai.console.service.device.DeviceService;
import com.uzai.console.service.report.RealTimeOverviewV2ReportService;
import com.uzai.console.vo.device.DeviceInfoVo;
import com.uzai.console.vo.report.RealTimeOverviewResultVo;
import com.uzai.console.vo.report.v2.*;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 实时总览
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "新版实时总览",tags = "数据报表|新版实时总览")
@ApiSort(50)
@RestController
public class RealTimeOverviewV2ReportController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(RealTimeOverviewV2ReportController.class);

    @Autowired
    private DeviceService deviceService;
    @Autowired
    private RealTimeOverviewV2ReportService realTimeOverviewV2ReportService;

    @ApiOperation(value = "查询机器人下拉列表", notes = "查询机器人下拉列表", response = DeviceInfoVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/report/v2/realTimeOverview/findDeviceList")
    public Object findDeviceList(@RequestBody DeviceQuery deviceQuery) {
        deviceQuery.setMerId(getLoginInfo().getMerId());
        return deviceService.findDeviceList(deviceQuery);
    }

    @ApiOperation(value = "新版实时总览报表-订单（实时总览统计页面第一块）", notes = "统计实时总览报表-订单（统计页面第一块）", response = RealTimeOverviewV2OrdeResultVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/report/v2/realTimeOverviewReport_order")
    public Object realTimeOverviewReport_order(@RequestBody RealTimeOverviewReportDto realTimeOverviewReportDto){
        return realTimeOverviewV2ReportService.realTimeOverviewV2Report_order(realTimeOverviewReportDto);
    }

    @ApiOperation(value = "新版实时总览报表-会员（实时总览统计页面第二块）", notes = "统计实时总览报表-会员（统计页面第二块）", response = RealTimeOverviewV2UserResultVo.class)
    @ApiOperationSupport(order = 3)
    @PostMapping("/report/v2/realTimeOverviewReport_user")
    public Object realTimeOverviewReport_user(@RequestBody RealTimeOverviewReportDto realTimeOverviewReportDto){
        return realTimeOverviewV2ReportService.realTimeOverviewV2Report_user(realTimeOverviewReportDto);
    }

    @ApiOperation(value = "新版实时总览报表-提现（实时总览统计页面第三块）", notes = "统计实时总览报表-提现（统计页面第三块）", response = RealTimeOverviewV2UserTakeResultVo.class)
    @ApiOperationSupport(order = 4)
    @PostMapping("/report/v2/realTimeOverviewReport_takeBal")
    public Object realTimeOverviewReport_takeBal(@RequestBody RealTimeOverviewReportDto realTimeOverviewReportDto){
        return realTimeOverviewV2ReportService.realTimeOverviewV2Report_takeBal(realTimeOverviewReportDto);
    }

    @ApiOperation(value = "新版实时总览报表-营销奖励（统计页面第四块）", notes = "统计实时总览报表-营销奖励（统计页面第四块）", response = RealTimeOverviewV2MarketingResultVo.class)
    @ApiOperationSupport(order = 4)
    @PostMapping("/report/v2/realTimeOverviewReport_marketing")
    public Object realTimeOverviewReport_marketing(@RequestBody RealTimeOverviewReportDto realTimeOverviewReportDto){
        return realTimeOverviewV2ReportService.realTimeOverviewV2Report_marketing(realTimeOverviewReportDto);
    }

    @ApiOperation(value = "新版实时总览报表-推广支出（统计页面第五块）", notes = "统计实时总览报表-推广支出（统计页面第五块）", response = RealTimeOverviewV2ExpendResultVo.class)
    @ApiOperationSupport(order = 5)
    @PostMapping("/report/v2/realTimeOverviewReport_expend")
    public Object realTimeOverviewReport_expend(@RequestBody RealTimeOverviewReportDto realTimeOverviewReportDto){
        return realTimeOverviewV2ReportService.realTimeOverviewReport_expend(realTimeOverviewReportDto);
    }

}
